function Ankhy_Paladin_1()
	ccRS.Auto_Target = false
	ccRS.Auto_Facing = false
	
	
	local vPlayerWithDebuff = ccrFindDebuffInGroup("Mark of Arrogance")
	if vPlayerWithDebuff ~= nil
		and ccrPlayerHasDebuff("Gift of the Titans")
		and ccrSpellIsReady("Cleanse")
	then
		ccrCast("Cleanse", vPlayerWithDebuff)
		return
	end
	if vPlayerWithDebuff ~= nil
		and ccrTargetName() == "Sha of Pride"
		and ccrTargetHealth() <= 30
		and ccrSpellIsReady("Cleanse")
	then
		ccrCast("Cleanse", vPlayerWithDebuff)
		return
	end
	
	------------------------
	-- TO DO LIST
	-- Heal the blobs on Immersius
	-- Heal and dispel the NPCs on Norushen
	-- Dispel Mark of Arrogance on Sha of Pride when have Gift of the Titans and when Sha have 30% or less health
	-- Stopcasting when Thok is casting Deafening Screech
	-- Cast BoP on players with 6 seconds left of "Iron Prison" debuff
	------------------------
	-- Holy Prism
	local vTalent = {GetTalentInfo(16)}
	local vGotHolyPrism = false
	if vTalent[6] == true then vGotHolyPrism = true else vGotHolyPrism = false end
	----------------
	-- Light's Hammer
	local vTalent = {GetTalentInfo(17)}
	local vGotLightsHammer = false
	if vTalent[6] == true then vGotLightsHammer = true else vGotLightsHammer = false end
	----------------
	-- Execution Sentence
	local vTalent = {GetTalentInfo(18)}
	local vGotExecutionSentence = false
	if vTalent[6] == true then vGotExecutionSentence = true else vGotExecutionSentence = false end
	---------------------
	-- Cast Blessings
	if not PlayerIsSOLO() then
		if not (ccrPlayerHasBuff("Mark of the Wild") or ccrPlayerHasBuff("Embrace of the Shale Spider") or ccrPlayerHasBuff("Legacy of the Emperor") or ccrPlayerHasBuff("Blessing of Kings"))
			then
				ccrCast("Blessing of Kings")
				return
		else
			if not (ccrPlayerHasBuff("Roar of Courage") or ccrPlayerHasBuff("Spirit Beast Blessing") or ccrPlayerHasBuff("Grace of Air") or ccrPlayerHasBuff("Blessing of Might"))
			then
				ccrCast("Blessing of Might")
				return
			end	
		end
	end	
	---------------------
	if ccrPlayerIsInCombat() then
		if tblTGetNearbyNPC ~= nil
		and #tblTGetNearbyNPC > 0 
		then
			for x = 1, #tblTGetNearbyNPC do
				local vNPC = tblTGetNearbyNPC[x]
				if vNPC
				and vNPC:Exists()
				and not vNPC:IsDead()
				and (
					vNPC:GetName() == "Contaminated Puddle"
					)
				then
					local vNPC_Health = (vNPC:GetHealth()/vNPC:GetMaxHealth()*100)
					if vNPC:GetAura("Lingering Corruption") ~= nil then
						vNPC:Target()
						vNPC:CastSpellByName("Cleanse")
					end
					if vNPC_Health < 100 then
						vNPC:Target()
						vNPC:CastSpellByName("Divine Light")
						return
					end
					if vNPC_Health < 100 then
						vNPC:Target()
						vNPC:CastSpellByName("Holy Light")
						return
					end
				end
			end
		end
		if tblTGetNearbyNPC ~= nil
		and #tblTGetNearbyNPC > 0 
		then
			for x = 1, #tblTGetNearbyNPC do
				local vNPC = tblTGetNearbyNPC[x]
				if vNPC
				and vNPC:Exists()
				and not vNPC:IsDead()
				and (
					vNPC:GetName() == "Leven Dawnblade"
					or vNPC:GetName() == "Rook Stonetoe"
					or vNPC:GetName() == "Sun Tenderheart"
					)
				then
					local vNPC_Health = (vNPC:GetHealth()/vNPC:GetMaxHealth()*100)
					if vNPC:GetAura("Lingering Corruption") ~= nil then
						vNPC:Target()
						vNPC:CastSpellByName("Cleanse")
					end
					if vNPC_Health < 100 then
						vNPC:Target()
						vNPC:CastSpellByName("Holy Light")
						return
					end
					if vNPC_Health < 100 then
						vNPC:Target()
						vNPC:CastSpellByName("Holy Radiance")
						return
					end
				end
			end
		end
	end
	--------------------------------- Heroic SOO

	--------------------------
	-- Find all nearby players
	Gather_Nearby_Players()
	--------------------------
	-- Autoaccept LFR invite
	AcceptProposal();
	--------------------------
	-- Autoaccept Resurrection
	AcceptResurrect();
	--------------------------
	-- Seal of Insight
	if ccR_Paladin_Aura() ~= 3 then
		ccrCast(SEAL_OF_INSIGHT)
		return
	end
	--------------------------
	-- Find who has the lowest health
	local vPlayerToHeal, vPlayerHealth = Find_Lowest_HP()
	if vPlayerToHeal ~= nil
	and vPlayerHealth ~= nil
	then
		-- Raid Specific
		if ccrUnitHasDebuff(vPlayerToHeal, "Strong Ancient Barrier", "any") then vPlayerHealth = 80 end
		if ccrUnitHasDebuff(vPlayerToHeal, "Ancient Barrier", "any") then vPlayerHealth = 60 end
		if ccrUnitHasDebuff(vPlayerToHeal, "Weak Ancient Barrier", "any") then vPlayerHealth = 40 end
		 
		-- Wait until casting is over 
		if ccrPlayerIsCastingOrChanneling() then return end
		-- Trinkets
		 -- OOC
			if UnitGroupRolesAssigned(vPlayerToHeal) == "TANK"
			and not ccrPlayerIsInCombat()
			and not ccrUnitHasMyBuff("Eternal Flame")
			and (ccrHolyPower() >= 3 or ccrPlayerHasBuff("Divine Purpose"))
			then
				ccrCast("Eternal Flame", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			end
			if ccrHolyPower() < 5
			and not ccrPlayerIsMoving()
			and not ccrPlayerIsInCombat()
				then
					ccrCast("Holy Radiance")
					return
			end
			if IsShiftKeyDown() then 
				ccrCast("Light's Hammer")
				CameraOrSelectOrMoveStart()
				CameraOrSelectOrMoveStop()
			return
		end
		if ccrPlayerIsInCombat() then
			UseTrinkets(); 
			
			-- Dispel
			if SpellIsReady("Cleanse") then
				if ccrUnitHasDebuffStacks(vPlayerToHeal, "Shadow Word: Bane", 2, "any")
				or ccrUnitHasDebuff(vPlayerToHeal, "Self-Absorbed")
				or ccrUnitHasDebuff(vPlayerToHeal, "Deteriorate")
				or ccrUnitHasDebuffStacks(vPlayerToHeal, "Corrosive Blood", 1, "any")
				then
					ccrCast("Cleanse", vPlayerToHeal)
					return
				end
			end
			
			--------------------------------- Mana \ Survival \ CD
			-- Divine Plea
			if ccrPlayerMana() <= 88
			and SpellIsReady("Divine Plea")
			then
				ccrCast("Divine Plea")
				return
			end
			
			-- Divine Shield
			if ccrPlayerHealth() <= 25
			and SpellIsReady("Divine Shield")
			then
			if ccrPlayerIsCastingOrChanneling() then SpellStopCasting() end
				ccrCast("Divine Shield", vPlayerToHeal)
				return
			end
			
			-- Hand of Sacrifice
			if vPlayerHealth <= 30
			and UnitGroupRolesAssigned(vPlayerToHeal) == "TANK"
			and ccrPlayerHealth() <= 60
			then
				ccrCast("Hand of Sacrifice", vPlayerToHeal)
				return
			end
			
			-- Hand of Protection
			if vPlayerHealth <= 20
			and SpellIsReady("Hand of Protection")
			then
			if ccrPlayerIsCastingOrChanneling() then SpellStopCasting() end
				ccrCast("Hand of Protection", vPlayerToHeal)
				return
			end
			
			-- Lay on Hands on player
			if ccrPlayerHealth() <= 15
			and SpellIsReady("Lay on Hands")
			then
			if ccrPlayerIsCastingOrChanneling() then SpellStopCasting() end
				ccrCast("Lay on Hands", vPlayerToHeal)
				return
			end
			
			--------------------------------- Tier 6 abilities
			if vGotHolyPrism then
			-- Light's Hammer
				if vPlayerHealth <= 90
				and SpellIsReady("Holy Prism")
				and not ccrPlayerIsMoving()
				then
					if GroupedPlayersHealth(vPlayerToHeal, 20, 90) >= 4
					then
						ccrCast("Holy Prism", vPlayerToHeal)
						return
					end
				end
			end
			
			--------------------------------- LMG proc \ Tank and raidhealing
			--- TANK ---
			-- Divine Heal
			if vPlayerHealth <= 30
			and UnitGroupRolesAssigned(vPlayerToHeal) == "TANK"
			and not ccrPlayerIsMoving()
			and ccrPlayerMana() <= 40
			then
			if ccrPlayerIsCastingOrChanneling() then SpellStopCasting() end
				ccrCast("Divine Heal", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			end
			
			-- Flash Heal
			if vPlayerHealth <= 35
			and UnitGroupRolesAssigned(vPlayerToHeal) == "TANK"
			and not ccrPlayerIsMoving()
			and ccrPlayerMana() <= 40
				then
				if ccrPlayerIsCastingOrChanneling() then SpellStopCasting() end
				ccrCast("Flash Heal", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			end
			
			-- Beacon of Light
			if vPlayerHealth <= 100
			and UnitGroupRolesAssigned(vPlayerToHeal) == "TANK"
			and SpellIsReady("Beacon of Light")
			then
				ccrCast("Beacon of Light", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			end
			
			-- Eternal Flame with 5 Holy Powers or Divine Purpose
			if UnitGroupRolesAssigned(vPlayerToHeal) == "TANK"
			and not ccrUnitHasMyBuff("Eternal Flame")
			and SpellIsReady("Eternal Flame")
			and (ccrHolyPower() >= 3 or ccrPlayerHasBuff("Divine Purpose"))
			then
				ccrCast("Eternal Flame", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			end
			-- Light of Dawn with 5 Holy Powers or Divine Purpose
			if (ccrHolyPower() == 5 or ccrPlayerHasBuff("Divine Purpose"))
			and not ccrPlayerIsMoving()
				then
					ccrCast("Light of Dawn", vPlayerToHeal)
				    if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
					return
			end
			-- MALKOROK --
			if ccrTargetName() == "Malkorok"
			and not ccrUnitHasMyBuff("Eternal Flame")
			and SpellIsReady("Eternal Flame")
			and (ccrHolyPower() >= 3 or ccrPlayerHasBuff("Divine Purpose"))
			then
				ccrCast("Eternal Flame", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			end

			--- RAID ---
			-- Light of Dawn with 5 Holy Powers
			if vPlayerHealth <= 95
			and SpellIsReady("Light of Dawn")
			and (ccrHolyPower() == 5 or ccrPlayerHasBuff("Divine Purpose"))
			and not ccrPlayerIsMoving()
			then
				if GroupedPlayersHealth(vPlayerToHeal, 40, 95) >= 4 then
					ccrCast("Light of Dawn", vPlayerToHeal)
					if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
					return
				end
			end
			
			-- Light of Dawn with 3 or more Holy Powers
			if vPlayerHealth <= 80
			and SpellIsReady("Light of Dawn")
			and (ccrHolyPower() >= 3 or ccrPlayerHasBuff("Divine Purpose"))
			and not ccrPlayerIsMoving()
			and GroupedPlayersHealth(vPlayerToHeal, 40, 80) >= 4
			then
				if not ccrPlayerIsCastingSpell("Holy Radiance")
						then SpellStopCasting() end 
					ccrCast("Light of Dawn", vPlayerToHeal)
					if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) 
					return
				end
			end
			
			-- Eternal Flame
			if vPlayerHealth <= 90
			and not ccrUnitHasMyBuff("Eternal Flame")
			and SpellIsReady("Eternal Flame")
			and (ccrHolyPower() == 5 or ccrPlayerHasBuff("Divine Purpose"))
			and GroupedPlayersHealth(vPlayerToHeal, 40, 90) <= 4
			then
				ccrCast("Eternal Flame", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			end
			if vPlayerHealth <= 70
			and SpellIsReady("Eternal Flame")
			and (ccrHolyPower() >= 3 or ccrPlayerHasBuff("Divine Purpose"))
			then
				ccrCast("Eternal Flame", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			end
			
			-- Holy Radiance with Infusion of Light
			if vPlayerHealth <= 90
			and SpellIsReady("Holy Radiance")
			and not ccrPlayerIsMoving()
			and ccrPlayerHasBuff("Infusion of Light")
			and GroupedPlayersHealth(vPlayerToHeal, 40, 90) >= 5
			then
				if not ccrPlayerIsCastingSpell("Holy Radiance")
						then SpellStopCasting() end 
					ccrCast("Holy Radiance", vPlayerToHeal)
					if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) 
					return
				end
			end
			
			-- Holy Radiance
			if vPlayerHealth <= 75
			and SpellIsReady("Holy Radiance")
			and not ccrPlayerIsMoving()
			and ccrPlayerMana() >= 30
			and GroupedPlayersHealth(vPlayerToHeal, 40, 75) >= 5
			then
				if not ccrPlayerIsCastingSpell("Holy Radiance")
						then SpellStopCasting() end 
					ccrCast("Holy Radiance", vPlayerToHeal)
					if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) 
					return
				end
			end
			
			-- Holy Radiance
			if vPlayerHealth <= 85
			and SpellIsReady("Holy Radiance")
			and not ccrPlayerIsMoving()
			and ccrPlayerMana() >= 60
			and GroupedPlayersHealth(vPlayerToHeal, 40, 85) >= 5
			then
				if not ccrPlayerIsCastingSpell("Holy Radiance")
						then SpellStopCasting() end 
					ccrCast("Holy Radiance", vPlayerToHeal)
					if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) 
					return
				end
			end
			
			-- Holy Radiance
			if vPlayerHealth <= 90
			and SpellIsReady("Holy Radiance")
			and not ccrPlayerIsMoving()
			and ccrPlayerMana() >= 85
			and GroupedPlayersHealth(vPlayerToHeal, 40, 90) >= 3
			then
				if not ccrPlayerIsCastingSpell("Holy Radiance")
						then SpellStopCasting() end 
					ccrCast("Holy Radiance", vPlayerToHeal)
					if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) 
					return
				end
			end
			-- Holy Radiance
			if vPlayerHealth <= 100
			and SpellIsReady("Holy Radiance")
			and not ccrPlayerIsMoving()
			and ccrPlayerMana() >= 92
			and GroupedPlayersHealth(vPlayerToHeal, 40, 100) >= 1
			then
				if not ccrPlayerIsCastingSpell("Holy Radiance")
						then SpellStopCasting() end 
					ccrCast("Holy Radiance", vPlayerToHeal)
					if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) 
					return
				end
			end
				-- Holy Shock
			if vPlayerHealth <= 100
			and UnitGroupRolesAssigned(vPlayerToHeal) == "TANK"
			and SpellIsReady("Holy Shock")
			then
				ccrCast("Holy Shock", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			else
				if vPlayerHealth <= 100
				and SpellIsReady("Holy Shock")
				then
					ccrCast("Holy Shock", vPlayerToHeal)
					if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
					return
				end
			end
			-- Holy Light
			if vPlayerHealth <= 90
			and not ccrPlayerIsMoving()
			and ccrPlayerHasBuff("Infusion of Light")
			and GroupedPlayersHealth(vPlayerToHeal, 40, 90) <= 6
			then
				ccrCast("Holy Light", vPlayerToHeal)
				if vTargetPlayerToHeal then TargetUnit(vPlayerToHeal) end
				return
			end
			-- Crusader Strike
			if UnitExists("target") == 1
			and SpellIsReady("Crusader Strike")
			and ccrPlayerIsInCombat()
			then
				ccrCast("Crusader Strike")
				return
			end
		end
	end	
end